package com.suxin.design.visitor;

/**
 * @author Tang
 * @classname Client
 * @description [  ]
 * @date 2022/9/20 13:47
 */
public class Client {
    public static void main(String[] args) {
        // 被访问者  接待者
        ComputerPart[] computerParts = new ComputerPart[]{new Keyboard(),new Mouse()};
        // 访问者
        ComputerDisplayPartVisitor partVisitor = new ComputerDisplayPartVisitor();

        // 接收访问者
        for (ComputerPart computerPart : computerParts) {
            computerPart.accept(partVisitor);
        }
    }
}
